package QueryExcecution;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import queryClass.Queries;

import DB.DAOManager;

public class EnterBankDetails {
	Queries q=new Queries();
	PreparedStatement pstmt=null;
	DAOManager dao;
	int rows = 0;
	public int fillBankDetails(String email,String bankname,String branchname,String accountno,String micr,String rtgs,String accounttype,String bankcity){
		try {
			dao = new DAOManager();
			Connection conn=dao.getConnection();
			String bankDetailsQuery=q.insertBankDetails;
			System.out.println(" in bank details filling");
			pstmt=conn.prepareStatement(bankDetailsQuery);	
			pstmt.setString(1, email);
			pstmt.setString(2, accountno);
			pstmt.setString(3, bankname);
			pstmt.setString(4, branchname);
			pstmt.setString(5, accounttype);
			pstmt.setString(6, micr);
			pstmt.setString(7, rtgs);
			pstmt.setString(8, bankcity);
			System.out.println("All int's and strings setted in bank");

			rows = pstmt.executeUpdate();

			
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return rows;
		
	}
}
